<?php

namespace Checklist\Form;

use Zend\InputFilter\InputFilter;

class TaskFilter extends InputFilter
{
    public function __construct() {
        $this->add(array(
            'name' => 'id' ,
            'required' => true , 
            'filters' => array(
                array(
                    'name' => 'Int'
                ),
            ),
        ));
        
        $this->add(array(
            'name' => 'title' ,
            'required' => true , 
            'filters' => array(
                array('name' => 'StripTags'),
                array('name' => 'StringTrim') ,
            ),
            'validators' => array(
                array(
                    'name' => 'StringLength' ,
                    'options' => array(
                        'encoding' => 'UTF-8' ,
                        'min' => 1 ,
                        'max' => 100 ,
                        //'messages' => 'Title khong duoc bo trong'
                    ),
                ),
            ),
        ));
        
        $this->add(array(
            'name' => 'completed' ,
            'required' => true ,             
        ));
    }
}
